package com.netas.kekmanager.dao;

import com.netas.kekmanager.dao.model.Rating;
import com.netas.kekmanager.dao.model.RatingPk;
import com.netas.kekmanager.dao.exceptions.RatingDaoException;
import java.util.List;

public interface RatingDao
{
	/**
	 * Method 'insert'
	 * 
	 * @param dto
	 * @return RatingPk
	 */
	public RatingPk insert(Rating dto);

	/** 
	 * Updates a single row in the rating table.
	 */
	public void update(RatingPk pk, Rating dto) throws RatingDaoException;

	/** 
	 * Deletes a single row in the rating table.
	 */
	public void delete(RatingPk pk) throws RatingDaoException;

	/** 
	 * Returns all rows from the rating table that match the criteria 'id = :id'.
	 */
	public Rating findByPrimaryKey(int id) throws RatingDaoException;

	/** 
	 * Returns all rows from the rating table that match the criteria ''.
	 */
	public List<Rating> findAll() throws RatingDaoException;

	/** 
	 * Returns all rows from the rating table that match the criteria 'rating_type_id = :ratingTypeId'.
	 */
	public List<Rating> findByRatingType(int ratingTypeId) throws RatingDaoException;

	/** 
	 * Returns all rows from the rating table that match the criteria 'user_id = :userId'.
	 */
	public List<Rating> findByUser(int userId) throws RatingDaoException;

	/** 
	 * Returns all rows from the rating table that match the criteria 'web_resource_id = :webResourceId'.
	 */
	public List<Rating> findByWebResource(int webResourceId) throws RatingDaoException;

	/** 
	 * Returns all rows from the rating table that match the criteria 'id = :id'.
	 */
	public List<Rating> findWhereIdEquals(int id) throws RatingDaoException;

	/** 
	 * Returns all rows from the rating table that match the criteria 'web_resource_id = :webResourceId'.
	 */
	public List<Rating> findWhereWebResourceIdEquals(int webResourceId) throws RatingDaoException;

	/** 
	 * Returns all rows from the rating table that match the criteria 'rating_type_id = :ratingTypeId'.
	 */
	public List<Rating> findWhereRatingTypeIdEquals(int ratingTypeId) throws RatingDaoException;

	/** 
	 * Returns all rows from the rating table that match the criteria 'user_id = :userId'.
	 */
	public List<Rating> findWhereUserIdEquals(int userId) throws RatingDaoException;

	/** 
	 * Returns the rows from the rating table that matches the specified primary-key value.
	 */
	public Rating findByPrimaryKey(RatingPk pk) throws RatingDaoException;
        
        public  List<Rating> findWhereUserWebResourceEquals(int userId, int webResourceID)  throws RatingDaoException;

}
